package doublePointer;

/*
 *@description
 *@author hkfan
 *@version 1.0
 *@create 2025/5/28 11:14
 */
public class LeetCode_11 {
    public int maxArea(int[] height) {
        //1. 定义
        int i=0,j=height.length-1,res=0;
        //2. 循环处理
        while (i<j){
            res = Math.max(res,Math.min(height[i],height[j])*(j-i));
            if (height[i]<height[j]){
                i++;
            }else {
                j--;
            }

        }
        return res;
    }
}
